package cn.gjculture.shopping.api.entity;

import cn.gjculture.shopping.api.util.DateUtil;
import cn.gjculture.shopping.api.util.UUIDUtil;
import lombok.Data;
import lombok.Getter;

@Data
public class Pay {

    private String payId;
    private String thirdSwiftNumber;
    private Integer thirdType;
    private String orderId;
    private String customerId;
    //总额
    private String amount;
    private Long insertTime;
    private Long payTime;
    //1-即时支付,2-退款
    private Integer payType=1;
    //0 进账，1,出账
    private Integer inAndOut=0;
    //1，新建，8，支付成功
    private Integer success=1;
    private String refundId;
    private Integer isRefund;
    private String sonMerNo;
    private Customer customer;
    private Long swiftNumber;

    public Pay(){

    }

    public Pay(boolean b) {
        if(b){
            this.payId= UUIDUtil.getUUID();
            this.insertTime= DateUtil.getTimestamp();
        }
    }

    public enum ThirdType{
        /**
         *  乾易付
         * */
        QYF(1,"乾易付");
        @Getter
        private Integer value;
        @Getter
        private String desc;

        ThirdType(Integer value, String desc){
            this.value=value;
            this.desc=desc;
        }
    }
    public enum PayType{
        IMMEDIATELY_PAY(1),REFUND(2),TRANSFER(3),SUPPLIER_WITHDRAW(4),CUSTOMER_WITHDRAW(5),ADMIN_WITHDRAW(6);
        @Getter
        private Integer value;
        PayType(int value){
            this.value=value;
        }
    }
    public enum InAndOut{
        IN(0),OUT(1);
        @Getter
        private Integer value;
        InAndOut(int value){
            this.value=value;
        }
    }

}
